<template>
  <div class="page-miH page-bgBack importsData-box">
    <PageHeader
      @back="
        $router.go(-1);
        $store.commit('check/componentName', 'imports');
      "
      subTitle="返回"
      class="PageHeaders"
    >
      导入考勤数据
    </PageHeader>
    <upload v-if="current === 0" @onAction="onAction" />
    <preview v-if="current === 1" :vJson="previewJson" @onAction="onAction" />
  </div>
</template>
<script>
import upload from "./component/upload";
import preview from "./component/preview";

export default {
  components: {
    upload,
    preview
  },
  data() {
    return {
      current: 0,
      status: false,
      rdata: "",
      previewJson: {}
    };
  },
  created() {
    // if (this.$store.state.recruitment.talentPoolTempId) {
    //   this.current = 1;
    //   this.talentPoolTempId = this.$store.state.recruitment.talentPoolTempId;
    // }
  },
  methods: {
    onAction(e, v) {
      this.current = e;
      if (v) {
        this.previewJson = v;
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.importsData-box {
  padding-bottom: 24px;
  .steps {
    height: 112px;
    // box-shadow: 0px 4px 12px 0px rgba(106, 102, 246, 0.1);
    background: #fafafa;
    border-radius: 4px;
    margin: 24px;
    padding: 40px 186px;
    box-sizing: border-box;
  }
}
</style>
